include <stdio.h>
void hanoi(int n, char a, char b, char c)
{
    if (n > 0)
    {
        hanoi(n - 1, a, c, b);
        printf("move dish %d form pile %c to %c", n, a, b);
        printf("\n");
        hanoi(n - 1, c, b, a);
    }
}
int main()
{
    int n;
    scanf("%d", &n);
    hanoi(n, 'A', 'B', 'C');
    return 0;
}